<template lang="pug">
div
  multiselect(
    :selected="selected",
    :options="options",
    @update="updateSelected",
    :allow-empty="false",
    :local-search="localSearch",
    :searchable="searchable",
    :show-labels="false",
    :placeholder="placeholder",
    :loading="loading",
    :close-on-select="closeOnSelect",
  )
</template>

<script>
import Multiselect from 'vue-multiselect'

export default {
  name: 'arraySingleSelect',
  components: {
    Multiselect,
  },
  props: {
    closeOnSelect: null,
    localSearch: null,
    searchable: {
      default: false
    },
    placeholder: null,
    options: null,
    update: null,
    selected: null,
    loading: null,
  },
  data () {
    return {
    }
  },
  methods: {
    updateSelected (val) {
      this.selected = val
      if (_.isFunction(this.update)) {
        this.update(val)
      }
    },
  },
}
</script>

<style lang="sass" scoped>
</style>
